home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / kernel / port / port.c < prev    next >
C/C++ Source or Header  |  1995-03-16  |  635b  |  36 lines

  1.  
  2.  
  3. /*  This file is used to help port the jumpto.s to a new platform  */
  4.  
  5. #include <stdio.h>
  6.  
  7. char    *obj = "Some object pointer";
  8.  
  9. char    *GenObj = "Some Generic Object Pointer";
  10.  
  11. typedef    int    (*ofun)();
  12.  
  13.  
  14. int    Method(char *self, int a, int b, int c)
  15. {
  16.     printf("Method reached with args %s %d %d %d\n", self, a, b, c);
  17.     return a + b + c;
  18. }
  19.  
  20. ofun    FindMethod(char *obj, char *gen)
  21. {
  22.     return Method;
  23. }
  24.  
  25. GenericFunction(char *self, ...)
  26. {
  27.     _jumpToMethod( FindMethod(self, GenObj) );
  28. }
  29.  
  30. main(void)
  31. {
  32.     int    r = GenericFunction(obj, 1, 2, 3);
  33.     printf("Value returned from GenericFunction = %d\n", r);
  34.     return 0;
  35. }
  36.